<template>
	<div id="amis-region"></div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue';

// 当前页面的路由信息
// @ts-ignore
const amis = amisRequire('amis/embed');
// @ts-ignore
const amisLib = amisRequire('amis');



        // 通过替换下面这个配置来生成不同页面
        let amisJSON = {
          type: 'page',
          title: '这是amis的页面',
          body: {
            type: 'form',
            mode: 'horizontal',
            api: '/saveForm',
            body: [
              {
                label: 'Name',
                type: 'input-text',
                name: 'name'
              },
              {
                label: 'Email',
                type: 'input-email',
                name: 'email'
              }
            ]
          }
        };

const render = (amisJSON:any)=>{
  amis.embed('#amis-region', amisJSON);
}
onMounted(() => {
  render(amisJSON)

    });

</script>

<style scoped>
</style>
